<template>
  <div >
    <span class="screen" @click="press" style="font-size: 20px;float: right;margin-top: 10px;margin-right: 20px;padding: 10px">立即跳转{{n}}秒</span>
    <img src="@/assets/logo_20220401_uugai.com-1648809107223.png" alt="" style="width: 100%">
  </div>
</template>

<script>
export default {
name: "screen",
  data(){
    return {
      flagTwo:true,
      n:5,
      // timer:null,
    }
  },
  methods:{
  press(){
    this.n = 0
    if(this.n == 0){
      this.$router.push({path:'/indexView'})
    }
  },
    autoPlay(){
      setInterval(this.play,1000)
    },
    play(){
      this.n--
      if(this.n == 0){
        this.$router.push({path:'/indexView'})
      }
    }
  },
  mounted() {
    this.autoPlay()
  }
}
</script>

<style scoped lang="less">
  .screen {
    border: 1px solid black;
    border-radius: 25px;
  }
</style>